﻿@using S4Store.Domain
@{
    S4Store.Domain.Administrator CurrentUser = (S4Store.Domain.Administrator)ViewBag.CurrentUser;
}
@model S4Store.Models.Markting.GXZLModel
@{
    Layout = null;
    ViewBag.Title = "GXZL";
}
<div style="height:100%; overflow:auto">
@Html.Action("ReportBar", "Common", Model.BarModel)
<div style=" width:100%; height:30px; background:#E5EDEF">
    <div ratio="#25" class="panelBar" style="height: 25px;">
	<ul class="toolBar">
	@if (
                           CurrentUser.Position == S4Store.Domain.Position.SystemManager ||
                           CurrentUser.Position == S4Store.Domain.Position.SaleTutors ||
                           CurrentUser.Position == S4Store.Domain.Position.DealerTutors
                           )
		{
		<li class="historyrecord"><a  backtype="html" href="@Url.Action("AddImproveGuide", "ImproveGuide", new { guidetype = S4Store.Domain.ImproveGuide.ImproveGuideType.Markting.ToInt()  ,referdesc="营销管理>营销活动计划>广宣计划>纸媒广告集客贡献度"})" target="dialog" width="60%"><span class="icon edit">填写改善指导建议</span></a></li>
		}
		<li class="historyrecord"><a  backtype="html" href="@Url.Action("GXZLHistory")" target="navtab" width="30%"  title="广宣质量KPI历史数据查询"><span class="icon search">历史数据查询</span></a></li>
	</ul>
</div>
</div>
    <div style="margin:20px; text-align:center">@Model.BarModel.Month.ToString("yyyy年M月") 广宣投入KPI概况</div>
    <table  class="reporttable"  style="border-collapse:collapse; width:100%">     
    <tr height="158"  class="vtr">
    <th width="60"  class="inputedheader"><div>执行月度</div></th>
    <th width="65"  class="inputedheader" colspan="2"><div>执行周</div></th>
    <th   class="calculated"><div>广宣主题</div></th>
    <th   class="calculated"><div>纸媒广告资金投放额︵<br />万<br />︶</div></th>
    <th   class="calculated"><div>广告招来电话批次</div></th>
    <th   class="calculated"><div>当月交车数</div></th>
    <th   class="calculated"><div>交车客户回访调研数</div></th>
    <th   class="calculated"><div>单次客户集客成本︵<br />万<br />︶</div></th>
    <th   class="calculated"><div>广告集客贡献度</div></th>
    <th   class="calculated"><div>客户调研分析率</div></th>
</tr>

@{
    for(int i=1;i<=8;i++)
    {
        var weekdata = Model.Report.ExhibitionWeekDatas.FirstOrDefault(t => t.WeekIndex == i);
        var weekreport = new S4Store.Domain.ExhibitionKpi.ExhibitionWeekReport(Model.Report, i); 
        
            <tr height="26" style="height:19.5pt" class="xl65">
                @if(i==1){
                <td rowspan="8" align="center">@(Model.Report.Month)月</td>
                }
                @if (i % 2 == 1)
                {
                <td rowspan="2" align="center">第@((i - 1) / 2 + 1)周</td>
                }
                @if (i % 2 == 1)
                {
                <td align="center">周六</td>
                }
                else
                {
                <td align="center">周日</td>
                }
                @if (weekdata != null)
                {
                <td align="center">@weekdata.GXZT</td>
                }
                else
                {                
                <td></td>
                }

                 @if (i % 2 == 1)
                 {
                    <td align="center" rowspan="2">@weekreport.CTGGZJTFE.toInt()</td>
                 }
                 @if (i % 2 == 1)
                 {
                    <td align="center"  rowspan="2">@weekreport.GGZLDHPC</td>
                 }
                 @if (i % 2 == 1)
                 {
                    <td align="center"  rowspan="2">@weekreport.JCS</td>
                 }
                 @if (i % 2 == 1)
                 {
                    <td align="center"  rowspan="2">@weekreport.JCKHMTDYS</td>
                 }
                 @if (i % 2 == 1)
                 {
                    <td align="center" @S4Store.Utils.GetBgColor(weekreport.DCKHJKCB >= Model.Report.ExhibitionKpiStandard.DCKHJKCB)  rowspan="2" >@weekreport.DCKHJKCB.toInt()</td>
                 }


                 @if (i % 2 == 1)
                 {
                    <td  rowspan="2" align="center" @S4Store.Utils.GetBgColor(weekreport.CTGGJKGXD >= Model.Report.ExhibitionKpiStandard.CTGGJKGXD)>@weekreport.CTGGJKGXD.toInt()%</td>
                 }
                 @if (i % 2 == 1)
                 {
                    <td  rowspan="2" align="center" @S4Store.Utils.GetBgColor(weekreport.KHDYFXLV >= Model.Report.ExhibitionKpiStandard.KHDYFXLV)>@weekreport.KHDYFXLV.toInt()%</td>
                 }
                
            </tr>
       
    }
}
<tr>
    <th colspan="4">合计</th>
    <td align="center">@Model.Report.CTGGZJTFE.toInt()</td>
    <td align="center">@Model.Report.GGZLDHPC</td>
    <td align="center">@Model.Report.JCS</td>
    <td align="center">@Model.Report.JCKHMTDYS</td>
    <td align="center" @S4Store.Utils.GetBgColor(Model.Report.DCKHJKCB >= Model.Report.ExhibitionKpiStandard.DCKHJKCB)>@Model.Report.DCKHJKCB.toInt()</td>
    <td align="center" @S4Store.Utils.GetBgColor(Model.Report.CTGGJKGXD >= Model.Report.ExhibitionKpiStandard.CTGGJKGXD)>@Model.Report.CTGGJKGXD.toInt()%</td>
    <td align="center" @S4Store.Utils.GetBgColor(Model.Report.KHDYFXLV >= Model.Report.ExhibitionKpiStandard.KHDYFXLV)>@Model.Report.KHDYFXLV.toInt()%</td>
</tr>
<tr>
    <th colspan="4">考核标准</th>
    <td align="center"></td>
    <td align="center"></td>
    <td align="center"></td>
    <td align="center"></td>
    <td align="center">@Model.Report.ExhibitionKpiStandard.DCKHJKCB.toInt()</td>
    <td align="center">@Model.Report.ExhibitionKpiStandard.CTGGJKGXD.toInt()%</td>
    <td align="center">@Model.Report.ExhibitionKpiStandard.KHDYFXLV.toInt()%</td>
</tr>
        </table>
    
        
</div>

